// https : // iai.sh.cn/problem/238  
#include <bits/stdc++.h>
        using namespace std;
int main() {
  string s;
  cin >> s;
  string olds = s;
  int len = s.size();
  for (int i = 0; i <= len - 1; i++) {
    if (s[i] == '2' || s[i] == '3' || s[i] == '4' || s[i] == '5' ||
        s[i] == '7') {
      cout << "Not a strobogrammatic number";
      return 0;
    }
  }
  reverse(s.begin(), s.end());
  for (int i = 0; i <= len - 1; i++) {
    if (s[i] == '9')
      s[i] = '6';
    else if (s[i] == '6')
      s[i] = '9';
  }
//   cout << olds <<" "<<s;
  if (s == olds)
    cout << "Strobogrammatic number";
  else
    cout << "Not a strobogrammatic number";

  return 0;
}